<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<style>
<!--
#userIncidentHistoryGridPager_right {
	display: none
}
-->
</style>


<div id="helpInfoContainer">
	<div class="bbox">
		<h3 class="title">
			用户历史事件（<label id="userIncidentHistoryGridCount" style="color:red">0</label>）
		</h3>
		<div id="historyIcd">
			<isperp:grid
				url="incident/incident/listByCusUser?cusUserId=${model.cusUserId }"
				showSearchbar="false" postData="all:1"
				gridId="userIncidentHistoryGrid" rowNum="5" multiselect="false"
				height="180" autoload="false" cusDialogSize="big"
				cusFormatterActions="false" rownumbers="false"
				ondbClickRowEvent="userIncidentHistoryGrid.view(rowid);"
				showToolbar="false" cusViewUrl="incident/incident/view"
				loadComplete=" $('#userIncidentHistoryGridCount').text( userIncidentHistoryGrid.jqGrid.getGridParam('records'));">
				<isperp:column name="id" title="ID" hidden="true"></isperp:column>
				<isperp:column name="title" width="120" title="标题"></isperp:column>
				<isperp:column name="createDate" width="110" title="申报时间"></isperp:column>
				<isperp:column name="status" width="45" title="状态"></isperp:column>
			</isperp:grid>
		</div>


	</div>
	<div class="bbox" style="margin-top:10px">
		<h3 class="title">项目服务目录</h3>
		<isperp:grid gridId="srcServiceGrid" url="" showPager="false"
			rownumbers="false" rowNum="20" cusFormatterActions="false"
			height="180" ondbClickRowEvent="srcServiceGridSelected();"
			showSearchbar="false" showToolbar="false" autoload="false">
			<isperp:column name="id" title="ID" hidden="true"></isperp:column>
			<isperp:column name="name" title="名称" width="150"
				isFormatterFun="true" formatter="return formatSrcName(rowObject);"></isperp:column>
			<isperp:column name="contents" title="服务内容" width="90"></isperp:column>
			<isperp:column name="code" title="操作" isFormatterFun="true"
				width="80"
				formatter="return formatSelector(rowObject,'srcServiceGrid');"></isperp:column>

		</isperp:grid>
	</div>

	<div class="bbox tabs tabbedBox" style="margin-top:10px;border:none">


		<div class="header">
			<ul>
				<li class="current"><a href="#divSimilarIncident">类似事件（<label
						id="similarIncidentsGridCount" style="color:red">0</label>）</a>
				</li>
				<li><a href="#divKnowledge">相关解决方案（<label
						id="knowledgeGridCount" style="color:red">0</label>）</a>
				</li>
			</ul>
			<h2>&nbsp;</h2>
		</div>
		<div style="padding:0 8px 0 0;border: 1px solid #bbb;border-top:none"
			class="content tabbed">

			<div id="divSimilarIncident">

				<isperp:grid gridTitle="类似事件" gridId="similarIncidentGrid"
					url="incident/incident/searchSimilarIncidents" autowidth="true"
					showSearchbar="false" rowNum="20" multiselect="false" height="180"
					showToolbar="false" autoload="false" cusDialogSize="big"
					cusFormatterActions="false" pager="false" showPager="false"
					cusViewUrl="incident/incident/view"
					loadComplete=" $('#similarIncidentsGridCount').text( similarIncidentGrid.jqGrid.getGridParam('records'));"
					ondbClickRowEvent="similarIncidentGrid.view(rowid);">
					<isperp:column name="id" title="ID" hidden="true"></isperp:column>
					<isperp:column name="code" width="120" title="事件编号" hidden="true"></isperp:column>
					<isperp:column name="title" width="120" title="事件标题"></isperp:column>
					<isperp:column name="description" width="150" title="事件描述"></isperp:column>
				</isperp:grid>

			</div>

			<div id="divKnowledge">
				<isperp:grid gridId="knowledgeGrid" url="" autowidth="true"
					multiselect="false"
					loadComplete=" $('#knowledgeGridCount').text( knowledgeGrid.jqGrid.getGridParam('records'));"
					showToolbar="false" cusFormatterActions="false" cusDialogSize="big"
					cusViewUrl="knowledge/knowledgeSearch/knowledgeInfoView"
					ondbClickRowEvent="knowledgeGrid.view(rowid);" rowNum="5"
					height="200" showSearchbar="false" autoload="false">
					<isperp:column name="id" title="ID" hidden="true"></isperp:column>
					<isperp:column name="title" width="120" title="标题"></isperp:column>
					<isperp:column name="contents" width="150" title="详细内容"></isperp:column>
				</isperp:grid>

			</div>


		</div>

	</div>
</div>

<script type="text/javascript">
<!--
	//搜索解决方案
	var searchKnowledge = function(keyword) {
		if (keyword) {
			knowledgeGrid.jqGrid.setGridParam({
				url : "knowledge/knowledgeSearch/searchByKeyword?keyword=" + keyword
			});

			knowledgeGrid.search();
		}
	};

	var searchLimiarIncident = function(keyword) {
		//查询类似事件
		if (keyword) {
			var condition = {
				"field" : "title",
				"op" : "cn",
				"data" : keyword
			};
			similarIncidentGrid.search(condition);
		}
	};

	var searchService = function(projectId, keyword) {
		if (projectId) {
			srcServiceGrid.jqGrid.setGridParam({
				url : "project/service/listDetail?keyword=" + keyword + "&projectId=" + projectId
			});
			srcServiceGrid.search();
		}
	};

	function searchHelpInfo(projectId, keyword) {
		//searchService(projectId, keyword);
		searchLimiarIncident(keyword);
		searchKnowledge(keyword);
	}
//-->
</script>